package com.starinside.wp.controller.api;

import com.starinside.wp.foundation.model.StatusResponse;
import com.starinside.wp.utils.HttpClient;
import com.starinside.wp.utils.JsonUtil;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.Map;

/**
 * /api/sso/other_system/staffInfoList
 */
@RestController
@RequestMapping("/children/staff")
@Api(tags = "老师")
class ApiChildrenTeacherStaffApiController {


    @Value("${teach.server.url}")
    private String teacherServerURL;



    /**
     * 获取老师评价列表
     */
    @PostMapping("/getList")
    public StatusResponse getList(@RequestBody Map<String,Object> mapTeacher ) throws IOException {
        String s = HttpClient.doPost(teacherServerURL + "/api/web/classes/teacherDetail",mapTeacher);
        Map map = JsonUtil.readToMap(s);
        return StatusResponse.success(map.get("data"));
    }

}
